#include <stdio.h>

void err()
{
	printf("-ERR:DIV by Zero.\n");
}

void OK(int a)
{
	printf("%x\n", a);
}

int func()
{
	__asm{
		xor edx, edx
		test ebx, ebx
		jz _err
		div ebx
		ret

		_err:
		stc
		ret
	}
}

int func2(int a, int b)
{
	__asm {
		mov eax, [esp+4]
		mov ebx, [esp+8]
		call func
		jnc _ok
		call err
		ret

		_ok:
			push eax
			call ok
			add esp, 4
			ret
	}
}

int main()
{
    func2(4, 0);

	return 0;
}

/*

 */


